using System;

namespace Welcome
{
	/// <summary>
	/// Summary description for IntIndexer.
	/// </summary>
	public class IntIndexer
	{
		private string[] myData;

		public IntIndexer(int size)
		{
			myData = new string[size];
			for(int i = 0; i < size; i++ )
			{
				myData[i] = "empty";
			}
		}
		
		public string this[int pos]
		{
			get 
			{
				return myData[pos];
			}
			set
			{
				myData[pos] = value;
			}
		}

		public static void Main()
		{
			int size = 10;
			IntIndexer myInd = new IntIndexer(size);

			myInd[9] = "Some value";
			myInd[3] = "Another value";
			myInd[5] = "Any value";

			Console.WriteLine("\nIndexer output\n");

			for(int i = 0; i < size; i++)
			{
				Console.WriteLine("myInd[{0}]: {1}", i, myInd[i]);
			}
			Console.ReadLine();
		}
	}
}
